<?php
namespace frontend\controllers;

use common\models\DhCore;
use common\models\Email;
use Yii;
use yii\web\Controller;
use common\models\YmhSeo;
use common\models\Product;

class CoreController extends Controller {

    public function actionCore() {
        $request = Yii::$app->request;

        $seo=YmhSeo::findOne(3);
        $view = Yii::$app->view;
        $view->params['layout_data']['menu'] = 'core';
        $view->params['layout_data']['seo'] = $seo;
        $pro_list = Product::getProCat();
        $view->params['layout_data']['pro_list'] = $pro_list;

        $coreList = DhCore::find()->orderBy('order desc')->all();

        return $this->render("core",['pro_list'=>$pro_list,'coreList'=>$coreList]);
    } 
    
    
    public function actionMCore(){
        $this->layout = 'main_local';
        $request = Yii::$app->request;
        $id = $request->get('id');
        $seo=YmhSeo::findOne(3);
        $view = Yii::$app->view;
        $view->params['layout_data']['menu'] = 'product';
        $view->params['layout_data']['seo'] = $seo;
        $pro_list = Product::getProCat();
        $view->params['layout_data']['pro_list'] = $pro_list;
        $coreList = DhCore::find()->orderBy('order desc')->all();

        return $this->render("m-core",['pro_list'=>$pro_list,'coreList'=>$coreList]);
    }

}

?>